package com.ruoyi.dl.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dl.mapper.DlOrdersMapper;
import com.ruoyi.dl.domain.DlOrders;
import com.ruoyi.dl.service.IDlOrdersService;
import com.ruoyi.common.core.text.Convert;

/**
 * 订单Service业务层处理
 *
 * @author ruoyi
 * @date 2020-12-28
 */
@Service
public class DlOrdersServiceImpl implements IDlOrdersService {
    @Autowired
    private DlOrdersMapper dlOrdersMapper;

    /**
     * 查询订单
     *
     * @param id 订单ID
     * @return 订单
     */
    @Override
    public DlOrders selectDlOrdersById(Integer id) {
        return dlOrdersMapper.selectDlOrdersById(id);
    }

    /**
     * 查询订单列表
     *
     * @param dlOrders 订单
     * @return 订单
     */
    @Override
    public List<DlOrders> selectDlOrdersList(DlOrders dlOrders) {
        return dlOrdersMapper.selectDlOrdersList(dlOrders);
    }

    /**
     * 查询订单列表
     *
     * @param dlOrders 订单
     * @return 订单
     */
    @Override
    public DlOrders selectDlOrdersByOrdersNumber(DlOrders dlOrders) {
        return dlOrdersMapper.selectDlOrdersByOrdersNumber(dlOrders);
    }

    /**
     * 查询订单列表
     *
     * @param dlOrders 订单
     * @return 订单
     */
    @Override
    public List<DlOrders> mySelectDlOrdersList(DlOrders dlOrders) {
        return dlOrdersMapper.newSelectDlOrdersList(dlOrders);
    }

    /**
     * 新增订单
     *
     * @param dlOrders 订单
     * @return 结果
     */
    @Override
    public int insertDlOrders(DlOrders dlOrders) {
        dlOrders.setCreateTime(DateUtils.getNowDate());
        return dlOrdersMapper.insertDlOrders(dlOrders);
    }

    /**
     * 修改订单
     *
     * @param dlOrders 订单
     * @return 结果
     */
    @Override
    public int updateDlOrders(DlOrders dlOrders) {
        return dlOrdersMapper.updateDlOrders(dlOrders);
    }

    /**
     * 删除订单对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteDlOrdersByIds(String ids) {
        return dlOrdersMapper.deleteDlOrdersByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除订单信息
     *
     * @param id 订单ID
     * @return 结果
     */
    @Override
    public int deleteDlOrdersById(Integer id) {
        return dlOrdersMapper.deleteDlOrdersById(id);
    }
}
